package com.ndp.fb.enums.adresource;

import lombok.Getter;
import lombok.Setter;

/**
 * Created by Evan on 2015/10/20.
 */
@Getter
public enum ThirdPicReviewStatus {

    //待机器审核
    WAIT_MACHINE_REVIEW("WAIT_MACHINE_REVIEW", 0),

    //人工审核通过
    PERSON_REVIEW_PASS("PERSON_REVIEW_PASS", 1),

    //人工审核不通过
    PERSON_REVIEW_NOPASS("PERSON_REVIEW_NOPASS", 2),

    //机器审核中
    MACHINE_REVIEWING("MACHINE_REVIEWING", 4),

    //机器审核通过
    MACHINE_REVIEW_PASS("MACHINE_REVIEW_PASS", 5),

    //机器审核不通过
    MACHINE_REVIEW_NOPASS("MACHINE_REVIEW_NOPASS", 6);

    /**
     * status
     */
    private String status;

    /**
     * code
     */
    private int code;

    /**
     * AdGroupStatus
     *
     * @param status status
     * @param code   code
     */
    ThirdPicReviewStatus(String status, int code) {
        this.status = status;
        this.code = code;
    }

    /**
     * 根据code获取Status
     *
     * @param code code
     * @return Status
     */
    public static ThirdPicReviewStatus getStatus(int code) {
        for (ThirdPicReviewStatus c : ThirdPicReviewStatus.values()) {
            if (c.code == code) {
                return c;
            }
        }
        return null;
    }

    /**
     * 根据status获取Status
     *
     * @param status status
     * @return Status
     */
    public static ThirdPicReviewStatus getStatus(String status) {
        for (ThirdPicReviewStatus c : ThirdPicReviewStatus.values()) {
            if (c.status.equals(status)) {
                return c;
            }
        }
        return null;
    }
}
